package com.shaokel.controller;

import com.shaokel.service.BlogService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @author 少丶客
 * @ClassName archiveShowController
 * @Description TODO
 * @Date 2020/7/4 13:43
 * @Vesion 1.0
 */
@Controller
public class archiveShowController {

    @Autowired
    private BlogService blogService;

    @GetMapping("/archives")
    public String archives(Model model){
        model.addAttribute("archiveMap",blogService.archiveBlog());
        model.addAttribute("blogCount",blogService.countBlog());
        return "archives";
    }

}